import pytest
from api.hm02_api import IhrmApi
from common.hm03_assert import Ihrmcommon
from common.read_data import read_ihrmLogin


class TestIhrmLoin:
    @pytest.mark.parametrize("mobile,password,state_code,success,code,message", read_ihrmLogin())
    # 测试用例
    def test_login_success(self, mobile, password, state_code, success, code, message):
        login_data = {"mobile": mobile, "password": password}
        login_result = IhrmApi.login(login_data)
        Ihrmcommon.login_common(login_result, state_code, success, code, message)
